package cj.primariaiquest.ws.service;

import java.util.Random;

import org.springframework.stereotype.Service;

import cj.primariaiquest.ws.exception.OutOfNumbersException;


@Service
public class TicketServiceImpl implements TicketService {

    @Override
    public long getNumber(final String department) throws OutOfNumbersException {
        Random rand = new Random();
        if (rand.nextLong() > 10000) {
            return 12;
        } else {
            throw new OutOfNumbersException("Sorry but we ran OUT OF NUMBERS.");
        }
    }

}
